package com.example.libraryManager.utils;

import com.example.libraryManager.vo.ResultVo;

public class ResultUtils {

    /**
     * 成功
     * @param data
     * @return
     */
    public static ResultVo success(Object data){
        ResultVo resultVo=new ResultVo();
        resultVo.setCode(0);
        resultVo.setData(data);
        return resultVo;
    }

    /**
     * 失败
     * @param code
     * @return
     */
    public static ResultVo failed(Integer code){
        ResultVo resultVo=new ResultVo();
        resultVo.setCode(code);
        resultVo.setData(null);
        return resultVo;
    }
}
